package net.xo68.destiny.core.timingwheel.handle;

import net.xo68.destiny.core.timingwheel.process.EventProcessorContext;

import java.io.Serializable;

/**
 * 时光轮事件处理者
 * @author wuxie
 * @version 2020-10-23
 * @param <T>
 */
public interface TimeoutEventHandler<T>
{

    /**
     * 开始前
     */
    default void onBefore(final EventProcessorContext<T> processorContext){

    };

    /**
     * 触发事件
     * @param processorContext
     * @throws Exception
     */
    void onEvent(final EventProcessorContext<T> processorContext) throws Exception;



    /**
     * 结束
     */
    default void onComplete(final EventProcessorContext<T> processorContext){

    };
}